using System;
using System.Collections.Generic;


namespace LiveCS.Models
{
	[Serializable]
	public class Historyfightingmember: IEquatable<Historyfightingmember>
	{

		#region Private Members

		private Temporarymember _cardid; 
		private int _memberstate; 
		private DateTime _gamestarttime; 
		private DateTime _deadtime; 
		private DateTime _cheattime; 
		private string _groupid; 
		private string _fightid; 
		private DateTime _gameovertime; 
		private Teamgroup _classid; 		
		#endregion

		#region Constructor

		public Historyfightingmember()
		{
			_cardid = new Temporarymember(); 
			_memberstate = 0; 
			_gamestarttime = DateTime.MinValue; 
			_deadtime = DateTime.MinValue; 
			_cheattime = DateTime.MinValue; 
			_groupid = String.Empty; 
			_fightid = String.Empty; 
			_gameovertime = DateTime.MinValue; 
			_classid = new Teamgroup(); 
		}
		#endregion // End of Default ( Empty ) Class Constuctor

		#region Public Properties
			
		public virtual Temporarymember Cardid
		{
			get
			{ 
				return _cardid;
			}
			set
			{
				_cardid = value;
			}

		}
			
		public virtual int MemberState
		{
			get
			{ 
				return _memberstate;
			}
			set
			{
				_memberstate = value;
			}

		}
			
		public virtual DateTime GameStartTime
		{
			get
			{ 
				return _gamestarttime;
			}
			set
			{
				_gamestarttime = value;
			}

		}
			
		public virtual DateTime DeadTime
		{
			get
			{ 
				return _deadtime;
			}
			set
			{
				_deadtime = value;
			}

		}
			
		public virtual DateTime CheatTime
		{
			get
			{ 
				return _cheattime;
			}
			set
			{
				_cheattime = value;
			}

		}
			
		public virtual string Groupid
		{
			get
			{ 
				return _groupid;
			}

			set	
			{	
				if(  value != null &&  value.Length > 20)
					throw new ArgumentOutOfRangeException("Invalid value for Groupid", value, value.ToString());
				
				_groupid = value;
			}
		}
			
		public virtual string Fightid
		{
			get
			{ 
				return _fightid;
			}

			set	
			{	
				if(  value != null &&  value.Length > 20)
					throw new ArgumentOutOfRangeException("Invalid value for Fightid", value, value.ToString());
				
				_fightid = value;
			}
		}
			
		public virtual DateTime GameOverTime
		{
			get
			{ 
				return _gameovertime;
			}
			set
			{
				_gameovertime = value;
			}

		}
			
		public virtual Teamgroup Classid
		{
			get
			{ 
				return _classid;
			}
			set
			{
				_classid = value;
			}

		}
			
				
		#endregion 

		#region Public Functions

		#endregion //Public Functions

		#region Equals And HashCode Overrides
		/// <summary>
		/// local implementation of Equals based on unique value members
		/// </summary>
		public override bool Equals( object obj )
		{
			if( this == obj ) return true;
			if( ( obj == null ) || ( obj.GetType() != this.GetType() ) ) return false;
			Historyfightingmember castObj = (Historyfightingmember)obj; 
			return castObj.GetHashCode() == this.GetHashCode();
		}
		
		/// <summary>
		/// local implementation of GetHashCode based on unique value members
		/// </summary>
		public override int GetHashCode()
		{
			return this.GetType().FullName.GetHashCode();
				
		}
		#endregion
		
		#region IEquatable members

		public bool Equals(Historyfightingmember other)
		{
			if (other == this)
				return true;
		
			return other.GetHashCode() == this.GetHashCode();
				   
		}

		#endregion
		
	}
}
